<html>
<head>
<meta http-equiv=Content-Type content=text/html;charset=utf-8>
<#include "/xadmin/inc/common.html">
<script type="text/JavaScript">
	function doSave(){
		var jscdArray = [];
		//半选节点
		var nodes = $('#tree').tree('getChecked');
		//半选节点
		var nodes2 = $('#tree').tree('getChecked','indeterminate');
		nodes = nodes.concat(nodes2);
		//alert(nodes.length);
		for(var i=0;i<nodes.length;i++){
			if(nodes[i].attributes){
				if(nodes[i].attributes.jscd){
					jscdArray.push(nodes[i].id);
				}
			}
		}
		$.post("qxmanage-setrole", 
				   { "jsdm": "${jsdm!}",
				   	"jscd" : jscdArray.join(","),
				   },
				   function(data){
				   	top.messagershow(data);
				   	top.windowObj.dialog('close');;
				});
	}

	//
	$(function(){
		$("#tree").tree({
            method: "post",
            lines: true,
            url: "qxmanage-listjsfortree?jsdm=${jsdm!}",
            dataPlain: true,       //该属性用以启用当前 easyui-tree 控件对平滑数据格式的支持
            toggleOnClick: false,
            checkbox: true,
            fit:true
        });
	})
</script>
</head>
<body >
<div class="easyui-panel" data-options='fit:true,border:false'>  
<ul id="tree"></ul>
</div>
</body>
</html>